package com.zzyl.controller.customer;

import com.zzyl.base.PageResponse;
import com.zzyl.base.ResponseResult;
import com.zzyl.controller.BaseController;
import com.zzyl.service.NursingProjectService;
import com.zzyl.vo.LoginVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@Api(tags = "预约管理")
@RestController
@RequestMapping("/customer/orders")
public class CustomerServeController extends BaseController {

    @Autowired
    private NursingProjectService nursingProjectService;

    /**
     * 分页查询护理项目列表
     */
    @GetMapping("/project/page")
    @ApiOperation("分页查询护理项目列表")
    public ResponseResult<PageResponse> selectByPage(
            Integer pageNum,
            Integer pageSize,
            String name,
            Integer status// 状态：0：禁用，1：启用
    ) {
        return success(nursingProjectService.selectByPage(pageNum, pageSize, name, status));
    }

    /**
     * 根据编号查询护理项目信息
     */
    @GetMapping("/project/{id}")
    @ApiOperation("根据编号查询护理项目信息")
    public ResponseResult<LoginVo> selectById(@PathVariable Long id) {
        return success(nursingProjectService.getById(id));
    }
}
